package com.example.huadi1.controller;

import com.example.huadi1.dto.Account;
import com.example.huadi1.service.LoginService;
import com.example.huadi1.utils.AjaxResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@Slf4j
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping()
    public AjaxResult login(@RequestBody Account account){
        return loginService.login(account);
    }
}
